﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>
    <link href="~/Content/bootstrap.css" rel="stylesheet" />
    <link href="~/bootstrap-table-master/dist/bootstrap-table.css" rel="stylesheet" />
</head>
<body>
    <div class="container">
        @*<button class='btn btn-default'>添加</button>*@
        <table id="table"></table>
    </div>
</body>
</html>
<script src="~/Scripts/jquery-3.3.1.min.js"></script>
<script src="~/Scripts/bootstrap.js"></script>
<script src="~/bootstrap-table-master/dist/bootstrap-table.min.js"></script>
<script src="~/bootstrap-table-master/dist/bootstrap-table.js"></script>
<script src="~/bootstrap-table-master/dist/locale/bootstrap-table-zh-CN.js"></script>
<script>
    $(function () {
        $("#table").bootstrapTable({
            url: "https://localhost:44394/api/student/GetStuinfo",
            method: "Get",
            pagination: true,
            columns: [
                {
                    field: "id",
                    title: "id"
                },
                {
                    field: "StrName",
                    title: "姓名"
                },
                {
                    field: "sex",
                    title: "性别"
                },
                {
                    field: "s",
                    title: "婚否"
                },
                {
                    field: "GradeName",
                    title: "年级"
                },
                {
                    title: "头像",
                    formatter: function (value, row) {
                        return "<img src=" + row.Photo + "/>";
                    }
                },
                {
                    formatter: function (value, row) {
                        return "<button class='btn btn-default' data-id='" + row.id + "' name='delete'>删除</button>"
                    }
                }
            ]
        }); 
    })
</script>
